package br.fmapn.process.entities;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.ManyToMany;
import javax.persistence.ManyToOne;

/**
 * Entity class representing a UserBusinessProcess
 * @author Fellipe
 */
@Entity
public class UserBusinessProcess implements Serializable {
	private static final long serialVersionUID = -2388518835502850504L;
	private int id;
	private Date date;
	private List<UserBusinessOperation> userBusinessOperation = new ArrayList<UserBusinessOperation>();
	private BusinessProcess businessProcess;
	public UserBusinessProcess() {
		super();
	}
	
	@Id
	@GeneratedValue
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	public Date getDate() {
		return date;
	}
	public void setDate(Date date) {
		this.date = date;
	}
	
	@ManyToMany
	public List<UserBusinessOperation> getUserBusinessOperation() {
		return userBusinessOperation;
	}
	public void setUserBusinessOperation(
			List<UserBusinessOperation> userBusinessOperation) {
		this.userBusinessOperation = userBusinessOperation;
	}
	
	@ManyToOne(fetch = FetchType.EAGER)
	public BusinessProcess getBusinessProcess() {
		return businessProcess;
	}
	public void setBusinessProcess(BusinessProcess businessProcess) {
		this.businessProcess = businessProcess;
	}
}
